package com.erdos.upc.entity;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import com.erdos.common.entity.AbstractEntity;


public class User extends AbstractEntity {
	private String name;

	private String pin;

	private String password;

	private String gender;

	private Short state;

	private String phone1;

	private String phone2;

	private String email;

	private String tel;
	
	/** 登陆班组 */
	private String loginGroup;
	//设备编号：2009-10-07添加
	private String facilityNo;
	
	/**
	 * 用户可访问的应用系统列表
	 */
	@SuppressWarnings("unchecked")
	private List appLists = new ArrayList();
	/**
	 * 用户组列表
	 */
	private List<Group> groups;
	
	/**
	 * 用户工厂安全角色列表
	 */
	private List<SecurityRole> securityRoles;	

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPin() {
		return pin;
	}

	public void setPin(String pin) {
		this.pin = pin;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Short getState() {
		return state;
	}

	public void setState(Short state) {
		this.state = state;
	}

	public String getPhone1() {
		return phone1;
	}

	public void setPhone1(String phone1) {
		this.phone1 = phone1;
	}

	public String getPhone2() {
		return phone2;
	}

	public void setPhone2(String phone2) {
		this.phone2 = phone2;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public List<Group> getGroups() {
		return groups;
	}

	public void setGroups(List<Group> groups) {
		this.groups = groups;
	}
	/**
	 * equals方法复写
	 */
	public boolean equals(Object o) {
		if (!(o instanceof User)) {
			return false;
		}
		User user = (User) o;
		return new EqualsBuilder().append(this.getPin(), user.getPin()).isEquals();
	}

	/**
	 * hashCode方法复写
	 */
	public int hashCode() {
		return new HashCodeBuilder(61, 15).append(this.getPin()).toHashCode();
	}

	/**
	 * @return the appLists
	 */
	public List getAppLists() {
		return appLists;
	}

	/**
	 * @param appLists the appLists to set
	 */
	public void setAppLists(List appLists) {
		this.appLists = appLists;
	}

	/**
	 * @return the loginGroup
	 */
	public String getLoginGroup() {
		return loginGroup;
	}

	/**
	 * @param loginGroup the loginGroup to set
	 */
	public void setLoginGroup(String loginGroup) {
		this.loginGroup = loginGroup;
	}

	/**
	 * @return the securityRoles
	 */
	public List<SecurityRole> getSecurityRoles() {
		return securityRoles;
	}

	/**
	 * @param securityRoles the securityRoles to set
	 */
	public void setSecurityRoles(List<SecurityRole> securityRoles) {
		this.securityRoles = securityRoles;
	}

	/**
	 * @return the facilityNo
	 */
	public String getFacilityNo() {
		return facilityNo;
	}

	/**
	 * @param facilityNo the facilityNo to set
	 */
	public void setFacilityNo(String facilityNo) {
		this.facilityNo = facilityNo;
	}
}